Skip tests that use whiteouts under Docker/aufs
authorSimon McVittie <smcv@debian.org>
Fri, 5 Aug 2016 19:41:05 +0000 (20:41 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 5 Aug 2016 20:32:57 +0000 (20:32 +0000)
ostree's naming convention for whiteouts is similar to what is
done in aufs, which means we can't compose the trees to test this
feature under Docker with the aufs storage driver, as used on
travis-ci.

Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #437
Approved by: cgwalters

tests/basic-test.sh

index d4c9aaf241fb1809bb38ab31a2d4f88705372c24..c4828d9049198b1d7913e748474034dd478e27eb 100755 (executable)
@@ -452,38 +452,41 @@ echo "ok test error pre commit/bootid"
 # Whiteouts
 cd ${test_tmpdir}
 mkdir -p overlay/baz/
-touch overlay/baz/.wh.cow
-touch overlay/.wh.deeper
-touch overlay/anewfile
-mkdir overlay/anewdir/
-touch overlay/anewdir/blah
-$OSTREE --repo=repo commit -b overlay -s 'overlay' --tree=dir=overlay
-rm overlay -rf
-
-for branch in test2 overlay; do
-    $OSTREE --repo=repo checkout --union --whiteouts ${branch} overlay-co
-done
-for f in .wh.deeper baz/cow baz/.wh.cow; do
-    assert_not_has_file overlay-co/${f}
-done
-assert_not_has_dir overlay-co/deeper
-assert_has_file overlay-co/anewdir/blah
-assert_has_file overlay-co/anewfile
-
-echo "ok whiteouts enabled"
-
-# Now double check whiteouts are not processed without --whiteouts 
-rm overlay-co -rf
-for branch in test2 overlay; do
-    $OSTREE --repo=repo checkout --union ${branch} overlay-co
-done
-for f in .wh.deeper baz/cow baz/.wh.cow; do
-    assert_has_file overlay-co/${f}
-done
-assert_not_has_dir overlay-co/deeper
-assert_has_file overlay-co/anewdir/blah
-assert_has_file overlay-co/anewfile
-echo "ok whiteouts disabled"
+if touch overlay/baz/.wh.cow && touch overlay/.wh.deeper; then
+    touch overlay/anewfile
+    mkdir overlay/anewdir/
+    touch overlay/anewdir/blah
+    $OSTREE --repo=repo commit -b overlay -s 'overlay' --tree=dir=overlay
+    rm overlay -rf
+
+    for branch in test2 overlay; do
+        $OSTREE --repo=repo checkout --union --whiteouts ${branch} overlay-co
+    done
+    for f in .wh.deeper baz/cow baz/.wh.cow; do
+        assert_not_has_file overlay-co/${f}
+    done
+    assert_not_has_dir overlay-co/deeper
+    assert_has_file overlay-co/anewdir/blah
+    assert_has_file overlay-co/anewfile
+
+    echo "ok whiteouts enabled"
+
+    # Now double check whiteouts are not processed without --whiteouts
+    rm overlay-co -rf
+    for branch in test2 overlay; do
+        $OSTREE --repo=repo checkout --union ${branch} overlay-co
+    done
+    for f in .wh.deeper baz/cow baz/.wh.cow; do
+        assert_has_file overlay-co/${f}
+    done
+    assert_not_has_dir overlay-co/deeper
+    assert_has_file overlay-co/anewdir/blah
+    assert_has_file overlay-co/anewfile
+    echo "ok whiteouts disabled"
+else
+    echo "ok # SKIP whiteouts do not work, are you using aufs?"
+    echo "ok # SKIP whiteouts do not work, are you using aufs?"
+fi
 
 cd ${test_tmpdir}
 rm -rf test2-checkout